/*
 * @Author: your name
 * @Date: 2021-06-04 14:57:18
 * @LastEditTime: 2021-08-12 20:48:06
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /shb-pc-fe/src/directive/elSelectLoadmore.js
 */

import LoadMore from '@src/directive/loadmore'

function getSelectElement(el) {
  return el.querySelector(
    '.el-select-dropdown .el-select-dropdown__wrap'
  )
}

const ElSelectLoadmoreDirective = {
  bind(el, binding, vnode){
    const selectElement = getSelectElement(el)
    LoadMore.bind(selectElement, binding, vnode)
  },
  unbind(el){
    const selectElement = getSelectElement(el)
    LoadMore.unbind(selectElement)
  }
}

export default ElSelectLoadmoreDirective
